from ch16.protobuf_test.proto import hello_pb2
import json
request = hello_pb2.HelloRequest()

request.name = "fadewalk"

res_str = request.SerializeToString()
print(res_str)
print(len(res_str))
res_json = {
    "name": "bobby"
}

request2 = hello_pb2.HelloRequest()
request2.ParseFromString(res_str)
print(request2.name)


print('json ', len(json.dumps(res_json)))
